<?php

namespace app\admin\controller;

use app\common\model\PayLog;
use think\Controller;
use think\Request;
class Invite extends Controller
{
    /**
     * 充值列表
     * @return void
     */
    public function index(){
        $i = new PayLog();
        if ($this->request->isPost()) {
           
        } else {
            if ($this->request->param('type') == 'get') {
                //获取分组信息
                $page = $this->request->param("page") ? $this->request->param("page") : 1;
                $page = intval($page);
                $limit = $this->request->param("limit") ? $this->request->param("limit") : 1;
                $limit = intval($limit);
                $start = $limit * ($page - 1);
                $key = $this->request->param('keyword');
                $user_list = $i->getuserlist($start, $limit, $key);
                return $user_list;
            }
            return $this->fetch('admin/main/invite');
        }
    }

    /**
     * 某个用户的详细推广信息
     * @return void
     */
    public function info(){
        $uid = $this->request->param('id');
        $i = new PayLog();
        if($this->request->isPost()){
            if($i->pop_settle($uid)){
                return json_x(0,'成功');
            }
            return json_x();
        }else{
            $this->assign([
                'info_0'=>$i->pop_info_0($uid),
                'info_1'=>$i->pop_info_1($uid),
                'uid'=>$uid
                ]);
            return $this->fetch('admin/main/invite_info');
        }
        
       
    }

}
